<template>
  <div class="wrapper">
    <v-head ></v-head>
    <vSidebar :sideList ="sideList"></vSidebar>


    <div class="content-box" :class="{'content-collapse':collapse}">
      <div class="content">
        <transition name="move" mode="out-in">
          <keep-alive :include="tagsList">
            <router-view :items="staff"></router-view>
          </keep-alive>
        </transition>
        <el-backtop target=".content"></el-backtop>
      </div>
    </div>

  </div>

</template>

<script>
  import Global from '../utils/global'
  import vHead from '../components/common/Header'
  import vSidebar from '../components/common/Sidebar'
  import vTags from '../components/common/Tags'
  import bus from '../components/common/bus'
  import SelfInfo from '../components/common/SelfInfo'
  import MyProject from '../components/manager/MyProject'
  import SalaryManage from '../components/manager/SalaryManage'
  import AddProject from '../components/manager/AddProject'

  export default {
    name: 'Manager',
    data() {
      return {
        glo:new Global,
        staff:{
          sName:null,
          sId:null,
          sType:null,
          sSex:null,
          sIdNumber:null,
          sAddress:null,
          sTel:null,
          sUsername:null,
        },
        tagsList: [],
        collapse: false,
        sideList:null,//============sidelist//似乎不能动态的改变这个   呜呜呜

        //======================sidelist
      };
    },
    components: {
      SelfInfo,
      vHead,
      vSidebar,
      vTags
    },
    methods:{

    },
    created () {
      bus.$on('collapse-content', msg => {
        this.collapse = msg;
      });
      this.staff = this.glo.getData("StaffInfo")
      var ModelList = [
            {
              icon:'el-icon-user-solid',
              index:'SelfInfoM',//这里 应该是router-link
              title:'个人信息'
            },
            {
              icon:'el-icon-circle-plus-outline',
              index:'AddProject',
              title:'创建项目'
            },
            {
              icon:'el-icon-menu',
              index:'MyProject',
              title:'项目信息'
            },
            {
              icon:'el-icon-date',
              index:'MyNotCompeleteProject',
              title:'待完成项目'
            },
            {
              icon:'el-icon-message',
              index:'Message4Manage',
              title:'我的消息'
            }
          ]
        var OtherList =[
          {
            icon:'el-icon-user-solid',
            index:'SelfInfoM',//这里 应该是router-link
            title:'个人信息'
          },
          {
            icon:'el-icon-menu',
            index:'MyProject',
            title:'项目信息'
          },
          {
            icon:'el-icon-date',
            index:'MyNotCompeleteProject',
            title:'待完成项目'
          },
          {
            icon:'el-icon-edit',
            index:'SalaryManage',
            title:'员工工资评校'
          }
        ]
      if(this.staff.sType == 1){
        this.sideList = ModelList
      }else{
        this.sideList = OtherList
      }
      //
      // var query = this.$route.query;
      // console.log(this.$route.query)
      // this.staff.sName = this.$route.query.sName,
      // this.staff.sId = this.$route.query.sId,
      // this.staff.sType = this.$route.query.sType,
      // this.staff.sSex = this.$route.query.sSex,
      // this.staff.sIdNumber = this.$route.query.sIdNumber,
      // this.staff.sAddress = this.$route.query.sAddress,
      // this.staff.sTel = this.$route.query.sTel,
      // this.staff.sUsername = this.$route.query.sUsername;
      console.log("aaaaaaaaaaaaaaaa!")
    }
  }
</script>

<style scoped>

</style>
